-- @Author: 作者QQ381990860
-- @Date:   2022-09-15 23:53:42
-- @Last Modified by:   作者QQ381990860
-- @Last Modified time: 2022-09-17 04:43:32
--======================================================================--
-- @作者: QQ381990860
-- @创建时间:   2019-12-03 02:17:19
-- @Last Modified time: 2022-04-17 19:46:45
--======================================================================--
local 场景类_便捷打书 = class()
local format = string.format
local min = math.min
local max = math.max
local ceil = math.ceil
local floor = math.floor
local bwh = require("gge包围盒")
local bw = bwh(0,0,50,300)
local tp,zts1,zts
local xxx = 0
local yyy = 0
local 低级兽决={  ---高级必杀  高级进击必杀
	{"精神集中","神迹","盾气","合纵","否定信仰","法术暴击","冥思","永恒","夜战","法术防御","弱点水","慧根","迟钝","防御","感知","招架","弱点雷","弱点火","土属性吸收","再生","连击","毒","鬼魂术","法术波动","魔之心","神佑复生","偷袭","必杀","驱鬼","反震","反击","隐身","法术连击","火属性吸收","雷属性吸收","强力","弱点土","敏捷","幸运","飞行","吸血","水属性吸收","独行","法术反震","进击必杀","进击法暴","水攻", "烈火", "雷击", "落岩","遗志"},
	{"高级盾气","高级合纵","高级否定信仰","高级精神集中","高级慧根","高级法术抵抗","高级反震","高级防御","高级偷袭","高级冥思","高级雷属性吸收","高级法术波动","高级再生","高级吸血","高级毒","高级反击","高级夜战","高级神迹","高级飞行","高级强力","高级鬼魂术","高级驱鬼","高级幸运","高级法术暴击","高级魔之心","高级驱怪","高级敏捷","高级土属性吸收","高级感知","高级水属性吸收","高级独行","高级法术反震","高级进击必杀","高级进击法暴","高级遗志","高级必杀","高级火属性吸收","高级永恒","高级招架","高级连击","高级隐身","高级法术连击","高级神佑复生","奔雷咒", "水漫金山", "地狱烈火", "泰山压顶",},
	{"开门见山","张弛有道","哼哼哈兮","津津有味","净台妙谛","叱咤风云","出其不意","灵山禅语","无畏布施","乘胜追击","拘魂索命","理直气壮","溜之大吉","流沙轻音","食指大动","凝光练彩","昼伏夜出","势如破竹","凭风借力","神出鬼没","光照万象","北冥之渊","扶摇万里","逍遥游","水击三千","风起龙游","无赦魔决","欣欣向荣","万物之灵（火）","万物之灵（水）","万物之灵（金）","万物之灵（土）","万物之灵（木）","力大无穷（火）","力大无穷（金）","力大无穷（土）","力大无穷（水）","力大无穷（木）","神来气旺","灵能激发","从天而降","龙魂","大快朵颐","苍鸾怒击","浮云神马","千钧一怒","惊心一剑", "进阶力劈华山", "力劈华山", "壁垒击破", "月光", "夜舞倾城", "上古灵符", "善恶有报", "死亡召唤", "剑荡四方", "天降灵葫","须弥真言"},
	{"须弥真言"},
}
local 图标={
	{"精神集中","神迹","盾气","合纵","否定信仰","法术暴击","冥思","永恒","夜战","法术防御","弱点水","慧根","迟钝","防御","感知","招架","弱点雷","弱点火","土属性吸收","再生","连击","毒","鬼魂术","法术波动","魔之心","神佑复生","偷袭","必杀","驱鬼","反震","反击","隐身","法术连击","火属性吸收","雷属性吸收","强力","弱点土","敏捷","幸运","飞行","吸血","水属性吸收","独行","法术反震","进击必杀","进击法暴","水攻", "烈火", "雷击", "落岩","遗志"},
	{"高级盾气","高级合纵","高级否定信仰","高级精神集中","高级慧根","高级法术抵抗","高级反震","高级防御","高级偷袭","高级冥思","高级雷属性吸收","高级法术波动","高级再生","高级吸血","高级毒","高级反击","高级夜战","高级神迹","高级飞行","高级强力","高级鬼魂术","高级驱鬼","高级幸运","高级法术暴击","高级魔之心","高级驱怪","高级敏捷","高级土属性吸收","高级感知","高级水属性吸收","高级独行","高级法术反震","高级进击必杀","高级进击法暴","高级遗志","高级必杀","高级火属性吸收","高级永恒","高级招架","高级连击","高级隐身","高级法术连击","高级神佑复生","奔雷咒", "水漫金山", "地狱烈火", "泰山压顶"},
	{"开门见山","张弛有道","哼哼哈兮","津津有味","净台妙谛","叱咤风云","出其不意","灵山禅语","无畏布施","乘胜追击","拘魂索命","理直气壮","溜之大吉","流沙轻音","食指大动","凝光练彩","昼伏夜出","势如破竹","凭风借力","神出鬼没","光照万象","北冥之渊","扶摇万里","逍遥游","水击三千","风起龙游","无赦魔决","欣欣向荣","万物之灵（火）","万物之灵（水）","万物之灵（金）","万物之灵（土）","万物之灵（木）","力大无穷（火）","力大无穷（金）","力大无穷（土）","力大无穷（水）","力大无穷（木）","神来气旺","灵能激发","从天而降","龙魂","大快朵颐","苍鸾怒击","浮云神马","千钧一怒","惊心一剑", "进阶力劈华山", "力劈华山", "壁垒击破", "月光", "夜舞倾城", "上古灵符", "善恶有报", "死亡召唤", "剑荡四方", "天降灵葫","须弥真言"},
	{"灵能激发"},
}



local 图标资源={}
local max = 1
local insert = table.insert
local mouseb = 引擎.鼠标弹起

function 场景类_便捷打书:初始化(根)
	self.ID = 41
	self.x = 60+(全局游戏宽度-800)/2
	self.y = 5
	self.xx = 0
	self.yy = 0
	self.注释 = "便捷打书"
	tp = 根

	zts = tp.字体表.华康字体
	zts1 = tp.字体表.华康字体
		self.鼠标 = false
	self.焦点 = false
	self.可移动 = true
	local 资源 = 根.资源
	local 自适应 = 根._自适应
	local 按钮 = 根._按钮
	self.资源组 = {
		[1] = 根.资源:载入("签到背景1.png","加密图片"), --主背景
		[2] =  自适应.创建(9,1,75,50,3,9), --灰色背景块
		[3] =  {},
		[4] = 按钮.创建(根.资源:载入( 'MAX.7z',"网易WDF动画",2),0,0,3), --关闭
		[5] =  按钮.创建(资源:载入( 'MAX.7z',"网易WDF动画",1),0,0,4,true,true,"低级兽决"),
		[6] =  按钮.创建(资源:载入( 'MAX.7z',"网易WDF动画",1),0,0,4,true,true,"高级兽决"),
		[7] = 按钮.创建(自适应.创建(20,4,18,18,4,3),0,0,4,true,true), --上翻
		[8] = 按钮.创建(自适应.创建(21,4,18,18,4,3),0,0,4,true,true), --下翻
		[10] =  {},
		[11] =  按钮.创建(资源:载入( 'MAX.7z',"网易WDF动画",1),0,0,4,true,true,"一键存入背包兽决"),
		--[11] = 根._滑块(自适应.创建(11,4,15,40,2,3,nil),4,14,233,2), --滑块
		[12] = 按钮.创建( 资源:载入( 'MAX.7z',"网易WDF动画",1),0,0,4,true,true,"特殊兽决"),
		[13] = 按钮.创建( 资源:载入( 'MAX.7z',"网易WDF动画",1),0,0,4,true,true,"便捷炼妖"),
		[14] =  {},
		[15] =  按钮.创建(资源:载入( 'MAX.7z',"网易WDF动画",1),0,0,4,true,true,"一键学习选中兽决"),
		[16] =  按钮.创建(资源:载入( 'MAX.7z',"网易WDF动画",1),0,0,4,true,true,"出售此页全部兽决"),
		[17] = 根._小型选项栏.创建(自适应.创建(6,1,85,100,3,9),"请选择操作的召唤兽："),
		[18] = 按钮.创建(自适应.创建(21,4,18,18,4,3),0,0,4,true,true),
		[19] = 自适应.创建(3,1,100,18,1,3),
		[20] = 自适应.创建(3,1,285,18,1,3),
		[21] = 资源:载入('JM.dll',"网易WDF动画",0xE6490543),
		[22] = 资源:载入('JM.dll',"网易WDF动画",0x5FD1F401),
		[23] = 根.资源:载入("炼妖背景.png","加密图片"),
		[24] = 根.资源:载入("炼妖背景.png","加密图片"),
		[25] = 自适应.创建(3,1,75,18,1,3),
		[26] = 自适应.创建(3,1,35,18,1,3),
		[27] = 自适应.创建(3,1,45,18,1,3),
		[28] = 自适应.创建(3,1,35,18,1,3),
		
		[29] = 根._小型选项栏.创建(自适应.创建(6,1,85,100,3,9),"请选择操作的召唤兽："),
		[30] = 按钮.创建(自适应.创建(21,4,18,18,4,3),0,0,4,true,true),
		
		[31] = 根._小型选项栏.创建(自适应.创建(6,1,85,100,3,9),"请选择操作的召唤兽："),
		[32] = 按钮.创建(自适应.创建(21,4,18,18,4,3),0,0,4,true,true),
		
		[33] = 按钮.创建( 资源:载入( 'MAX.7z',"网易WDF动画","竖形按钮"),0,0,4,true,true,"清\n\n空\n\n界\n\n面"),
		[34] = 按钮.创建( 资源:载入( 'MAX.7z',"网易WDF动画","竖形按钮"),0,0,4,true,true,"确\n\n认\n\n合\n\n宠"),
		
		[35] = 资源:载入('MAX.7z',"网易WDF动画","重复提示"),
	}

	for i=1,4 do
		图标资源[i]={}
		for n=1,#图标[i] do
		  local f =  SkillData[图标[i][n]]
		  图标资源[i][n] = 资源:载入(f.文件,"网易WDF动画",f.大图标)
		end
	end
	
	
	
	self.资源组[18]:绑定窗口_(41)
	self.资源组[30]:绑定窗口_(41)
	self.资源组[32]:绑定窗口_(41)
	
	self.资源组[33]:绑定窗口_(41)
	self.资源组[33]:置偏移(0,8)
	self.资源组[34]:绑定窗口_(41)
	
	for i=4,8 do
	   self.资源组[i]:绑定窗口_(41)
	end
	self.资源组[5]:置偏移(25,2)
	self.资源组[6]:置偏移(25,2)
    self.资源组[11]:绑定窗口_(41)
	self.资源组[15]:绑定窗口_(41)
	self.资源组[16]:绑定窗口_(41)
	for i=12,13 do
	   self.资源组[i]:绑定窗口_(41)
	   self.资源组[i]:置偏移(25,2)
	end
    

	self.状态 = 1
	self.子类状态 = 1
	self.窗口时间 = 0
   self.资源组[3]={}
   self.资源组[10]={}
   self.资源组[14]={}
   self.选择购买=""
   self.选择购买1=""
   self.选择购买2=""
   self.选择购买3=""
   self.操作信息="无"
   self.选中确定 = {}
   self.重复技能 = {}
      
end


function 场景类_便捷打书:打开(数据)
local 自适应 = tp._自适应
	if self.可视 then
		self.可视 = false
		self.加入 = 0
		self.资源组[3]={}
		self.资源组[10]={}
		self.资源组[14]={}
	    self.状态 = 1
	   self.子类状态 = 1

	else

	   for i=1,4 do
	   	 self.资源组[3][i]={}
		 self.资源组[10][i]={}
		 self.资源组[14][i]={}
	   	 for n=1,#图标[i] do
	   	 	self.资源组[3][i][n]=tp._按钮.创建(自适应.创建(11,4,24,20,1,3),0,0,4,true,true,"售")
	   	 	self.资源组[3][i][n]:绑定窗口_(41)
			
			self.资源组[10][i][n]=tp._按钮.创建(自适应.创建(11,4,24,20,1,3),0,0,4,true,true,"取")
	   	 	self.资源组[10][i][n]:绑定窗口_(41)

	   	 end
	   end
		--self.资源组[11]:置起始点(0)
		self.bb技能 = {}
		self.bb技能1 = {}
		self.bb技能2 = {}
		self.bb技能3 = {}
		self.bb技能4 = {}
		self.bb技能5 = {}
		self.重复技能 = {}
		self.操作信息="无"
		self.选择购买=""
		self.选择购买1=""
		self.选择购买2=""
		self.选择购买3=""
		self.新宠 = 0
		self.加入 = 0
		self.加入1 = 0
		max=#低级兽决[self.状态]
		self.数据 ={}
        self.数据=数据
		 if self.数据[2] and #self.数据[2] > 0  then
          local n =  ModelData[self.数据[2][1].造型]
          self.bb头像 = tp.资源:载入(n.头像资源,"网易WDF动画",n.小头像)
		  self.选择购买=self.数据[2][1].名称.."_1"
		    if #self.数据[2][1].技能>0  then 
			   for i=1,#self.数据[2][1].技能  do
			     local f =  SkillData[self.数据[2][1].技能[i].名称]
			      self.bb技能[i]  = tp.资源:载入(f.文件,"网易WDF动画",f.大图标)
				  if self.数据[2][1].技能[i].认证   then 
				  self.bb技能1[i] = self.数据[2][1].技能[i].认证
				  end
				  if self.数据[2][1].技能[i].固神   then 
				  self.bb技能2[i] = self.数据[2][1].技能[i].固神
				  end
			  end
			end
	     end
		self.偏移1 = 0
		tp.运行时间 = tp.运行时间 + 1
	    self.窗口时间 = tp.运行时间
	    self.可视 = true
		self.选中确定 = {}
	    insert(tp.窗口_,self)
	end
end


function 场景类_便捷打书:刷新兽决(数据)

self.数据[1] = 数据

end

function 场景类_便捷打书:刷新技能(数据)

self.数据[2] = 数据

         if self.数据[2] and #self.数据[2] > 0  and self.选择购买~= "" then
                local n =  ModelData[self.数据[2][self:取编号(self.选择购买)].造型]
                 self.bb头像 = tp.资源:载入(n.头像资源,"网易WDF动画",n.小头像)
                     self.bb技能 = {}	
		             self.bb技能1 = {}
		             self.bb技能2 = {}					 
			        for i=1,#self.数据[2][self:取编号(self.选择购买)].技能  do
					  if i<= 48  then 
			          local f =  SkillData[self.数据[2][self:取编号(self.选择购买)].技能[i].名称]
			          self.bb技能[i]  = tp.资源:载入(f.文件,"网易WDF动画",f.大图标)
					   if self.数据[2][self:取编号(self.选择购买)].技能[i].认证   then 
				          self.bb技能1[i] = self.数据[2][self:取编号(self.选择购买)].技能[i].认证
				        end
				        if self.数据[2][self:取编号(self.选择购买)].技能[i].固神   then 
				          self.bb技能2[i] = self.数据[2][self:取编号(self.选择购买)].技能[i].固神
				        end
					  end
			        end
		end
		
	   self.选择购买1= ""
	   self.bb技能3 = {}
	   self.选择购买2= ""
	   self.bb技能4 = {}
       self.选择购买3= ""
	   self.bb技能5 = {}
       self.重复技能 = {}	   
end

function 场景类_便捷打书:刷新炼妖(数据)

      self.新宠 = 数据 + 0
       self.选择购买 = ""
	   self.bb技能 = {}	
	   self.bb技能1 = {}
	   self.bb技能2 = {}
	   self.选择购买1= ""
	   self.bb技能3 = {}
	   self.选择购买2= ""
	   self.bb技能4 = {}
       self.选择购买3= ""
	   self.bb技能5 = {}	
       self.重复技能 = {}	   
       self.bb头像 = nil
           self.选择购买3 = self.数据[2][self.新宠].名称.."_"..self.新宠
     
                local n =  ModelData[self.数据[2][self:取编号(self.选择购买3)].造型]

			        for i=1,#self.数据[2][self:取编号(self.选择购买3)].技能  do
					  if i<= 48  then 
			          local f =  SkillData[self.数据[2][self:取编号(self.选择购买3)].技能[i].名称]
			          self.bb技能5[i]  = tp.资源:载入(f.文件,"网易WDF动画",f.大图标)
					  end
			        end
	   
end


function 场景类_便捷打书:刷新操作信息(数据)

    self.操作信息 = 数据[1]
end

function 场景类_便捷打书:取名称(名称)

  if 名称~=nil  then 
     local 分割组 = 分割文本( 名称 ,"_")
      
     return 分割组[1]
  end

end

function 场景类_便捷打书:取编号(名称)

  if 名称~=nil  then 
     local 分割组 = 分割文本( 名称 ,"_")
     return 分割组[2] +0
  end

end

function 场景类_便捷打书:对比重复技能(技能1,技能2)

self.重复技能 = {}
local 重复技能 ={}
 for n=1,#技能1  do 
   for i=1,#技能2  do 
     if 技能1[n].名称 == 技能2[i].名称  then 
	    重复技能[#重复技能+1] = 技能1[n].名称
	 end
   end
 end
 if #重复技能>0  then 
   self.重复技能 = 重复技能
end

end 

function 场景类_便捷打书:显示(dt,x,y)
	self.资源组[4]:更新(x,y)
	self.资源组[11]:更新(x,y)
	self.资源组[15]:更新(x,y)
	self.资源组[16]:更新(x,y)
	self.资源组[18]:更新(x,y)
	self.资源组[5]:更新(x,y,self.状态 ~= 1)
	self.资源组[6]:更新(x,y,self.状态 ~= 2)
	self.资源组[12]:更新(x,y,self.状态 ~= 3)
	self.资源组[13]:更新(x,y,self.状态 ~= 4)
	tp.画线:置区域(0,0,15,250)
	   for i=1,4 do
	   	 for n=1,#图标[i] do
	   	 	self.资源组[3][i][n]:更新(x,y)
			self.资源组[10][i][n]:更新(x,y)
	   	 end
	   end
		self.资源组[7]:更新(x,y)
		self.资源组[8]:更新(x,y)


	 if self.资源组[4]:事件判断() then
		self:打开()
		return false
     end
	self.焦点 = false
	self.资源组[1]:显示(self.x-30,self.y)  --主背景
	 tp.字体表.描边字体:置颜色(0xFFFFFFFF):显示(self.x + 290 , self.y + 5,"便 捷 打 书")
	self.资源组[4]:显示(self.x+640,self.y)  --关闭
	self.资源组[5]:显示(self.x+50,self.y+35,true,1,nil,self.状态 == 1,2) ---低级兽决
	self.资源组[6]:显示(self.x+200,self.y+35,true,1,nil,self.状态 == 2,2) ---高级兽决
	self.资源组[12]:显示(self.x+350,self.y+35,true,1,nil,self.状态 == 3,2) ---特殊兽决
	self.资源组[13]:显示(self.x+500,self.y+35,true,1,nil,self.状态 == 4,2) ---便捷炼妖
	            if self.资源组[13]:事件判断() then
               	   self.状态 = 4
				 elseif self.资源组[5]:事件判断() then
               		self.状态 = 1
               		self.子类状态 = 1
               		max=#低级兽决[self.状态]
               		self.加入=0
					self.加入1 = 0
	           				self.选中确定 = {}
               elseif self.资源组[6]:事件判断() then
                         		self.状态 = 2
                         		self.子类状态 = 1
                         		max=#低级兽决[self.状态]
                         		self.加入=0
	           	            self.加入1 = 0
                              self.选中确定 = {}
               elseif self.资源组[12]:事件判断() then
                         		self.状态 = 3
               		self.子类状态 = 1
               		max=#低级兽决[self.状态]
               		self.加入=0
                 	self.加入1 = 0
					self.选中确定 = {}
				end

if self.状态 == 4	 then
  self.偏移1 = 0
  bw:置坐标(self.x+695,self.y+130)
  self.资源组[35]:更新(dt)
  self.资源组[30]:更新(x,y)
  self.资源组[32]:更新(x,y)
  self.资源组[33]:更新(x,y)
  self.资源组[34]:更新(x,y)
  self.资源组[23]:显示(self.x-20,self.y+230)
  self.资源组[24]:显示(self.x-20,self.y+63)
  
  local xxx1 = 0
	local yyy1 = 0
	
	if self.bb技能3 and #self.bb技能3 > 0  then 
	    for n=1,#self.bb技能3  do 
		  self.bb技能3[n]:显示(self.x+4+xxx1*42,self.y+124+yyy1*42)
		  
		  if #self.重复技能 > 0 and self.选择购买1~=""  then 
		    for i=1,#self.重复技能  do 
			  if self.数据[2][self:取编号(self.选择购买1)].技能[n].名称 == self.重复技能[i]  then
			     self.资源组[35]:显示(self.x+4+xxx1*42,self.y+124+yyy1*42)
			  end
			end
		  end
		  if self.bb技能3[n]:是否选中(x,y) and self.鼠标 and not tp.消息栏焦点  then
			 tp.提示:自定义(x+105,y-40,"#Y/".. self.数据[2][self:取编号(self.选择购买1)].技能[n].名称.."\n#S/"..SkillData[ self.数据[2][self:取编号(self.选择购买1)].技能[n].名称].介绍)
		   end
		  
		  
		  xxx1 = xxx1 +1
		 if  xxx1> 15  then 
		     xxx1 = 0
			 yyy1 = yyy1 +1
          end	 
		end
	end
	local xxx2 = 0
	local yyy2 = 0
		if self.bb技能4 and #self.bb技能4 > 0  then 
	    for n=1,#self.bb技能4  do 
		  self.bb技能4[n]:显示(self.x+4+xxx2*42,self.y+291+yyy2*42)
		 if #self.重复技能 > 0 and self.选择购买2~=""  then  
		    for i=1,#self.重复技能  do 
			   if self.数据[2][self:取编号(self.选择购买2)].技能[n].名称 == self.重复技能[i]  then
			     self.资源组[35]:显示(self.x+4+xxx2*42,self.y+291+yyy2*42)
			  end
			end
		  end
		  if self.bb技能4[n]:是否选中(x,y) and self.鼠标 and not tp.消息栏焦点  then
			 tp.提示:自定义(x+105,y-40,"#Y/".. self.数据[2][self:取编号(self.选择购买2)].技能[n].名称.."\n#S/"..SkillData[ self.数据[2][self:取编号(self.选择购买2)].技能[n].名称].介绍)
		   end
		  
		  xxx2 = xxx2 +1
		 if  xxx2> 15  then 
		     xxx2 = 0
			 yyy2 = yyy2 +1
          end	 
		end
	end
    local xxx3 = 0
	local yyy3 = 0
		if self.bb技能5 and #self.bb技能5 > 0  then 
	    for n=1,#self.bb技能5  do 
		
		  self.bb技能5[n]:显示(self.x+4+xxx3*42,self.y+458+yyy3*42)
		  
		  if self.bb技能5[n]:是否选中(x,y) and self.鼠标 and not tp.消息栏焦点 and self.选择购买3~=""  then
			 tp.提示:自定义(x+105,y-40,"#Y/".. self.数据[2][self:取编号(self.选择购买3)].技能[n].名称.."\n#S/"..SkillData[ self.数据[2][self:取编号(self.选择购买3)].技能[n].名称].介绍)
		   end
		   
		  xxx3 = xxx3 +1
		 if  xxx3> 15  then 
		     xxx3 = 0
			 yyy3 = yyy3 +1
          end	 
		end
	end
  
   
  
  
  
  tp.字体表.普通字体:置颜色(0xFFFFFFFF):显示(self.x , self.y + 93,"主:            类:      等:     攻:       防:       体:       法:       速:       躲:       成:")
  self.资源组[25]:显示(self.x+24,self.y+90)
  self.资源组[26]:显示(self.x+126,self.y+90)
  self.资源组[26]:显示(self.x+189,self.y+90)
  self.资源组[27]:显示(self.x+246,self.y+90)
  self.资源组[27]:显示(self.x+316,self.y+90)
  self.资源组[27]:显示(self.x+386,self.y+90)
  self.资源组[27]:显示(self.x+456,self.y+90)
  self.资源组[27]:显示(self.x+526,self.y+90)
  self.资源组[27]:显示(self.x+596,self.y+90)
  self.资源组[28]:显示(self.x+666,self.y+90)
    self.资源组[29]:显示(self.x-3,self.y+112,x,y,self.鼠标)
	self.资源组[30]:显示(self.x+82,self.y+91)
	if self.选择购买1~=""  then 
	tp.字体表.普通字体:置颜色(0xFF000000):显示(self.x + 26, self.y + 93,self:取名称(self.选择购买1))
    tp.字体表.普通字体:置颜色(0xFF000000):显示(self.x + 130, self.y + 93,self.数据[2][self:取编号(self.选择购买1)].类型)
	tp.字体表.普通字体:置颜色(0xFF000000):显示(self.x + 194, self.y + 93,self.数据[2][self:取编号(self.选择购买1)].等级)
	tp.字体表.普通字体:置颜色(0xFF000000):显示(self.x + 250, self.y + 93,self.数据[2][self:取编号(self.选择购买1)].攻资)
	tp.字体表.普通字体:置颜色(0xFF000000):显示(self.x + 321, self.y + 93,self.数据[2][self:取编号(self.选择购买1)].防资)
	tp.字体表.普通字体:置颜色(0xFF000000):显示(self.x + 392, self.y + 93,self.数据[2][self:取编号(self.选择购买1)].体资)
	tp.字体表.普通字体:置颜色(0xFF000000):显示(self.x + 463, self.y + 93,self.数据[2][self:取编号(self.选择购买1)].法资)
	tp.字体表.普通字体:置颜色(0xFF000000):显示(self.x + 531, self.y + 93,self.数据[2][self:取编号(self.选择购买1)].速资)
	tp.字体表.普通字体:置颜色(0xFF000000):显示(self.x + 601, self.y + 93,self.数据[2][self:取编号(self.选择购买1)].躲资)
	tp.字体表.普通字体:置颜色(0xFF000000):显示(self.x + 669, self.y + 93,self.数据[2][self:取编号(self.选择购买1)].成长)
    end 
  
  tp.字体表.普通字体:置颜色(0xFFFFFFFF):显示(self.x , self.y + 260,"副:            类:      等:     攻:       防:       体:       法:       速:       躲:       成:")
  self.资源组[25]:显示(self.x+24,self.y +257)
  self.资源组[26]:显示(self.x+126,self.y+257)
  self.资源组[26]:显示(self.x+189,self.y+257)
  self.资源组[27]:显示(self.x+246,self.y+257)
  self.资源组[27]:显示(self.x+316,self.y+257)
  self.资源组[27]:显示(self.x+386,self.y+257)
  self.资源组[27]:显示(self.x+456,self.y+257)
  self.资源组[27]:显示(self.x+526,self.y+257)
  self.资源组[27]:显示(self.x+596,self.y+257)
  self.资源组[28]:显示(self.x+666,self.y+257)
  
    self.资源组[31]:显示(self.x-3,self.y+279,x,y,self.鼠标)
	self.资源组[32]:显示(self.x+82,self.y+258)
	if self.选择购买2~=""  then 
	tp.字体表.普通字体:置颜色(0xFF000000):显示(self.x + 26, self.y + 260,self:取名称(self.选择购买2))
	--self.数据[2][self:取编号(self.选择购买1)].技能
	tp.字体表.普通字体:置颜色(0xFF000000):显示(self.x + 130, self.y + 260,self.数据[2][self:取编号(self.选择购买2)].类型)
	tp.字体表.普通字体:置颜色(0xFF000000):显示(self.x + 194, self.y + 260,self.数据[2][self:取编号(self.选择购买2)].等级)
	tp.字体表.普通字体:置颜色(0xFF000000):显示(self.x + 250, self.y + 260,self.数据[2][self:取编号(self.选择购买2)].攻资)
	tp.字体表.普通字体:置颜色(0xFF000000):显示(self.x + 321, self.y + 260,self.数据[2][self:取编号(self.选择购买2)].防资)
	tp.字体表.普通字体:置颜色(0xFF000000):显示(self.x + 392, self.y + 260,self.数据[2][self:取编号(self.选择购买2)].体资)
	tp.字体表.普通字体:置颜色(0xFF000000):显示(self.x + 463, self.y + 260,self.数据[2][self:取编号(self.选择购买2)].法资)
	tp.字体表.普通字体:置颜色(0xFF000000):显示(self.x + 531, self.y + 260,self.数据[2][self:取编号(self.选择购买2)].速资)
	tp.字体表.普通字体:置颜色(0xFF000000):显示(self.x + 601, self.y + 260,self.数据[2][self:取编号(self.选择购买2)].躲资)
	tp.字体表.普通字体:置颜色(0xFF000000):显示(self.x + 669, self.y + 260,self.数据[2][self:取编号(self.选择购买2)].成长)
    end 
	
  tp.字体表.普通字体:置颜色(0xFFFFFFFF):显示(self.x , self.y + 427,"结:            类:      等:     攻:       防:       体:       法:       速:       躲:       成:")
  self.资源组[25]:显示(self.x+24,self.y +423)
  self.资源组[26]:显示(self.x+126,self.y+423)
  self.资源组[26]:显示(self.x+189,self.y+423)
  self.资源组[27]:显示(self.x+246,self.y+423)
  self.资源组[27]:显示(self.x+316,self.y+423)
  self.资源组[27]:显示(self.x+386,self.y+423)
  self.资源组[27]:显示(self.x+456,self.y+423)
  self.资源组[27]:显示(self.x+526,self.y+423)
  self.资源组[27]:显示(self.x+596,self.y+423)
  self.资源组[28]:显示(self.x+666,self.y+423)
  
  if self.选择购买3~=""  and self.新宠~= 0 then 
	tp.字体表.普通字体:置颜色(0xFF000000):显示(self.x + 26, self.y + 427,self:取名称(self.选择购买3))
	--self.数据[2][self:取编号(self.选择购买1)].技能
	tp.字体表.普通字体:置颜色(0xFF000000):显示(self.x + 130, self.y + 427,self.数据[2][self:取编号(self.选择购买3)].类型)
	tp.字体表.普通字体:置颜色(0xFF000000):显示(self.x + 194, self.y + 427,self.数据[2][self:取编号(self.选择购买3)].等级)
	tp.字体表.普通字体:置颜色(0xFF000000):显示(self.x + 250, self.y + 427,self.数据[2][self:取编号(self.选择购买3)].攻资)
	tp.字体表.普通字体:置颜色(0xFF000000):显示(self.x + 321, self.y + 427,self.数据[2][self:取编号(self.选择购买3)].防资)
	tp.字体表.普通字体:置颜色(0xFF000000):显示(self.x + 392, self.y + 427,self.数据[2][self:取编号(self.选择购买3)].体资)
	tp.字体表.普通字体:置颜色(0xFF000000):显示(self.x + 463, self.y + 427,self.数据[2][self:取编号(self.选择购买3)].法资)
	tp.字体表.普通字体:置颜色(0xFF000000):显示(self.x + 531, self.y + 427,self.数据[2][self:取编号(self.选择购买3)].速资)
	tp.字体表.普通字体:置颜色(0xFF000000):显示(self.x + 601, self.y + 427,self.数据[2][self:取编号(self.选择购买3)].躲资)
	tp.字体表.普通字体:置颜色(0xFF000000):显示(self.x + 669, self.y + 427,self.数据[2][self:取编号(self.选择购买3)].成长)
    end 
	
  
    -- self.资源组[17]:显示(self.x+55,self.y+442,x,y,self.鼠标)
	-- self.资源组[18]:显示(self.x+140,self.y+421)
	self.资源组[33]:显示(self.x+696+self.偏移1,self.y+130+self.偏移1)
	self.资源组[34]:显示(self.x+696+self.偏移1,self.y+297+self.偏移1)
  
    if self.资源组[33]:事件判断() then 
	   self.偏移1 = 2
       -- self.选择购买1= ""
	   -- self.bb技能3 = {}
	   -- self.选择购买2= ""
	   -- self.bb技能4 = {}
	   -- self.选择购买3= ""
	   -- self.bb技能5 = {}
	客户端:发送数据(1, 28333, 13,"1", 1) --兽决名称 --宝宝格子
	elseif self.资源组[34]:事件判断() then 
	self.偏移1 = 2
	if self.选择购买1 == ""  or self.选择购买2 == ""  then 
	   tp.提示:写入("#Y/请同时选择主宠跟副宠召唤兽")
	  return
	end
	客户端:发送数据(self:取编号(self.选择购买1), 28222, 13, self:取编号(self.选择购买2), 1) --兽决名称 --宝宝格子

    elseif self.资源组[30]:事件判断() then 

      local tb={}
	  for n=1,#self.数据[2]  do 
	      table.insert(tb,self.数据[2][n].名称.."_"..n)
	  end
	  
	 self.资源组[29]:打开(tb)
	 self.资源组[29]:置选中(self.选择购买1)
	 
	elseif  self.资源组[29]:事件判断() then	 
			    self.资源组[29]:置选中(self.资源组[29].弹出事件)
            	self.选择购买1=self.资源组[29].弹出事件
                self.资源组[29].弹出事件 = nil 
				
				if self.选择购买1 == self.选择购买2  then 
				  self.选择购买1= ""
				  self.bb技能3 = {}
				 tp.提示:写入("#Y/请不要选择同一个的召唤兽")
				return
				end
				
				if self.选择购买1 ~= ""   and  self.选择购买2 ~= ""  and self.数据[2] and #self.数据[2][self:取编号(self.选择购买1)].技能>0  and #self.数据[2][self:取编号(self.选择购买2)].技能>0  then
				    self:对比重复技能(self.数据[2][self:取编号(self.选择购买1)].技能,self.数据[2][self:取编号(self.选择购买2)].技能)
				end
				
				
			  if self.数据[2] and #self.数据[2] > 0  then
                local n =  ModelData[self.数据[2][self:取编号(self.选择购买1)].造型]

                     self.bb技能3 = {}	
				 
			        for i=1,#self.数据[2][self:取编号(self.选择购买1)].技能  do
					  if i<= 48  then 
			          local f =  SkillData[self.数据[2][self:取编号(self.选择购买1)].技能[i].名称]
			          self.bb技能3[i]  = tp.资源:载入(f.文件,"网易WDF动画",f.大图标)
					  end
			        end
                 end
     elseif self.资源组[32]:事件判断() then 

      local tb={}
	  for n=1,#self.数据[2]  do 
	      table.insert(tb,self.数据[2][n].名称.."_"..n)
	  end
	  
	 self.资源组[31]:打开(tb)
	 
	 self.资源组[31]:置选中(self.选择购买2)
	 
	elseif  self.资源组[31]:事件判断() then	 
			    self.资源组[31]:置选中(self.资源组[31].弹出事件)
            	self.选择购买2=self.资源组[31].弹出事件
                self.资源组[31].弹出事件 = nil 
				if self.选择购买1 == self.选择购买2  then 
				   self.选择购买2= ""
				   self.bb技能4 = {}	
				 tp.提示:写入("#Y/请不要选择同一个的召唤兽")
				return
				end
				if self.选择购买1 ~= ""   and  self.选择购买2 ~= ""  and self.数据[2] and #self.数据[2][self:取编号(self.选择购买1)].技能>0  and #self.数据[2][self:取编号(self.选择购买2)].技能>0  then
				    self:对比重复技能(self.数据[2][self:取编号(self.选择购买1)].技能,self.数据[2][self:取编号(self.选择购买2)].技能)
				end
			  if self.数据[2] and #self.数据[2] > 0  then
                local n =  ModelData[self.数据[2][self:取编号(self.选择购买2)].造型]

                     self.bb技能4 = {}	
				 
			        for i=1,#self.数据[2][self:取编号(self.选择购买2)].技能  do
					  if i<= 48  then 
			          local f =  SkillData[self.数据[2][self:取编号(self.选择购买2)].技能[i].名称]
			          self.bb技能4[i]  = tp.资源:载入(f.文件,"网易WDF动画",f.大图标)
					  end
			        end
                 end				 
      end
end				
				
if self.状态 ~= 4	 then
	self.资源组[11]:显示(self.x+80,self.y+366) ---一键存入
	self.资源组[15]:显示(self.x+260,self.y+366) ---一键学习
	self.资源组[16]:显示(self.x+440,self.y+366) ---一键出售
	tp.画线:显示(self.x+625,self.y+93)  --移动框
		self.资源组[2]:置宽高(75,50)--灰色背景块
		self.资源组[7]:显示(self.x+622,self.y+74) --上翻
		self.资源组[8]:显示(self.x+622,self.y+343)--下翻
	tp.宠物头像背景_:显示(self.x+4,self.y+411)
	
	local xxx = 0
	local yyy = 0
	
	if self.bb技能 and #self.bb技能 > 0  then 
	    for n=1,#self.bb技能  do 
		  self.bb技能[n]:显示(self.x+4+xxx*42,self.y+458+yyy*42)
		  
		  if self.bb技能1 and self.bb技能1[n]  then
    	     tp.技能认证:显示(self.x+4+xxx*42,self.y+458+yyy*42)
	       end
	
	       if  self.bb技能2 and self.bb技能2[n]  then
    	     tp.固神:显示(self.x+4+xxx*42,self.y+458+yyy*42)
	        end
		   if self.bb技能[n]:是否选中(x,y) and self.鼠标 and not tp.消息栏焦点 and self.选择购买~=""  then
			 tp.提示:自定义(x+105,y-40,"#Y/".. self.数据[2][self:取编号(self.选择购买)].技能[n].名称.."\n#S/"..SkillData[ self.数据[2][self:取编号(self.选择购买)].技能[n].名称].介绍)
		   end
		  
		  
		  xxx = xxx +1
		 if  xxx> 15  then 
		     xxx = 0
			 yyy = yyy +1
          end	 
		end
	end
	

    if self.bb头像  then 
        self.bb头像:显示(self.x+7,self.y+416)
     end
	
	self.资源组[19]:显示(self.x+55,self.y+420)
    self.资源组[17]:显示(self.x+55,self.y+442,x,y,self.鼠标)
	self.资源组[18]:显示(self.x+140,self.y+421)
	
	 
	 tp.字体表.普通字体:置颜色(0xFFFFFFFF):显示(self.x +162 , self.y + 421,"认证：")
	 tp.技能认证:显示(self.x+212,self.y+411)
	 
	 tp.字体表.普通字体:置颜色(0xFFFFFFFF):显示(self.x + 257, self.y + 421,"固神：")
	 tp.固神:显示(self.x+307,self.y+411)
	 
	 tp.字体表.普通字体:置颜色(0xFFFFFFFF):显示(self.x + 367, self.y + 421,"提示:")
	 self.资源组[20]:显示(self.x+403,self.y+418)
	 if self.操作信息~=nil and self.操作信息~="" then
	  tp.字体表.普通字体:置颜色(0xFF000000):显示(self.x + 413, self.y + 422,self.操作信息.."!")
	 end
	
	if self.选择购买~=""  then 
	tp.字体表.普通字体:置颜色(0xFF000000):显示(self.x + 62, self.y + 423,self:取名称(self.选择购买))
    end  

   if self.资源组[18]:事件判断() then 

      local tb={}
	  for n=1,#self.数据[2]  do 
	      table.insert(tb,self.数据[2][n].名称.."_"..n)
	  end
	  
	 self.资源组[17]:打开(tb)
	 
	 self.资源组[17]:置选中(self.选择购买)
	 
	elseif  self.资源组[17]:事件判断() then	 
			    self.资源组[17]:置选中(self.资源组[17].弹出事件)
            	self.选择购买=self.资源组[17].弹出事件
                self.资源组[17].弹出事件 = nil 
			  if self.数据[2] and #self.数据[2] > 0  then
			 -- print(self:取名称(self.选择购买))
                local n =  ModelData[self.数据[2][self:取编号(self.选择购买)].造型]
				--table.print(n)
                 self.bb头像 = tp.资源:载入(n.头像资源,"网易WDF动画",n.小头像)
                     self.bb技能 = {}	
		             self.bb技能1 = {}
		             self.bb技能2 = {}					 
			        for i=1,#self.数据[2][self:取编号(self.选择购买)].技能  do
					  if i<= 48  then 
			          local f =  SkillData[self.数据[2][self:取编号(self.选择购买)].技能[i].名称]
			          self.bb技能[i]  = tp.资源:载入(f.文件,"网易WDF动画",f.大图标)
					   if self.数据[2][self:取编号(self.选择购买)].技能[i].认证   then 
				          self.bb技能1[i] = self.数据[2][self:取编号(self.选择购买)].技能[i].认证
				        end
				        if self.数据[2][self:取编号(self.选择购买)].技能[i].固神   then 
				          self.bb技能2[i] = self.数据[2][self:取编号(self.选择购买)].技能[i].固神
				        end
					  end
			        end
			      end

	 elseif self.资源组[11]:事件判断() then  ---一键存入	
                  客户端:发送数据(2, 27777, 13, "1", 1)
				 
     elseif self.资源组[16]:事件判断() then  ---一键出售全卖			   
				 客户端:发送数据(self.状态, 278888, 13, "1", 1)
	elseif self.资源组[15]:事件判断() then  ---一键学习	

			 local 临时选中 = false
			     for n=1,60  do
				   if self.选中确定[n] and self.选择购买~=""  then
				    临时选中 = true
                    客户端:发送数据(self:取编号(self.选择购买), 28111, 13,低级兽决[self.状态][n], 1) --兽决名称 --宝宝格子
				   end
				  end
				  
				  if 临时选中 == false  then 
				    tp.提示:写入("#Y/请先选中需要学习的兽决和需要打书召唤兽")
				  end
	 elseif self.资源组[7]:事件判断() then
				     self.加入 = 0
		             self.加入1 = 0
					 self.选中确定 = {}
	  elseif self.资源组[8]:事件判断() then
				    if max > 35 then
		             self.加入 = max - 35
		             self.加入1 = 35
                     self.选中确定 = {}
	               end
	
			
   end

		    local xx = 0
		    local yy = 0
			local jx = self.x+35
			local jy = self.y+65
			
			
			
			
			for n=1+self.加入1,35+self.加入 do
			if 低级兽决[self.状态][n]  then
				self.资源组[2]:显示(jx+20+xx*80,jy+15+yy*55)
				--self.资源组[21]:显示(jx+18+xx*100,jy+14+yy*85)
				-- zts:置颜色(0xFF000000):显示(jx+80+xx*100,jy+14+yy*85,低级兽决[self.状态][n])

	   	     	self.资源组[3][self.状态][n]:显示(jx+68+xx*80,jy+20+yy*55,true,1)
				self.资源组[10][self.状态][n]:显示(jx+68+xx*80,jy+42+yy*55,true,1)
				图标资源[self.状态][n]:显示(jx+25+xx*80,jy+21+yy*55)
				tp.字体表.描边字体:置颜色(0xFFFFFFFF):显示(jx+25+xx*80,jy+18+yy*55,self.数据[1][低级兽决[self.状态][n]])
				
				
				local jz = true
			  		
				if 	self.选中确定[n]  then 
				   tp.选中确定:显示(jx+22+xx*80,jy+18+yy*55)
				end
					
				
			if 图标资源[self.状态][n]:是否选中(x,y) and self.鼠标 and not tp.消息栏焦点  then
					if jz then
						tp.提示:自定义(x+105,y-40,"#Y/"..低级兽决[self.状态][n].."\n#S/"..SkillData[低级兽决[self.状态][n]].介绍)
					end
					tp.选中焦点:显示(jx+22+xx*80,jy+18+yy*55)
					self.焦点 = true
				       if mouseb(0) then
					   self.选中确定 = {}
					    self.选中确定[n] = true
						end
						
						
				 -- if 图标资源[self.状态][n]:事件判断() then 	
				    -- tp.选中确定:显示(jx+22+xx*80,jy+18+yy*55)
			     -- end
               elseif self.资源组[3][self.状态][n]:事件判断() then  ---单卖
			   
              --- tp.窗口.攻略:打开(低级兽决[self.状态][n])
			     tp.窗口.组合输入框:打开("兽决出售","当前兽决的数量为:"..self.数据[1][低级兽决[self.状态][n]],nil,低级兽决[self.状态][n].."_"..self.状态)
			   elseif self.资源组[10][self.状态][n]:事件判断() then  ---单取
			   
			     tp.窗口.组合输入框:打开("兽决取出","当前兽决的数量为:"..self.数据[1][低级兽决[self.状态][n]],nil,低级兽决[self.状态][n].."_"..self.状态)
			  
               		         
			  end
				xx = xx + 1
				if xx == 7 then
					xx = 0
					yy = yy + 1
				end
			end
      end --6
	 
	--if self.资源组[11].接触 then
	--self.焦点 = true
	--end
end

end
function 场景类_便捷打书:检查点(x,y)
   if self.可视 and self.资源组[1]:是否选中(x,y)  then
        return true
		
	elseif	 self.可视  and bw:检查点(x,y) then
	return true
    else
        return false
    end
end

function 场景类_便捷打书:初始移动(x,y)
    tp.运行时间 = tp.运行时间 + 1
    if not tp.消息栏焦点 then
        self.窗口时间 = tp.运行时间
    end
    if not self.焦点 then
        tp.移动窗口 = true
    end
    if self.鼠标 and  not self.焦点 then
        self.xx = x - self.x
        self.yy = y - self.y
    end
end

function 场景类_便捷打书:开始移动(x,y)
    if self.鼠标 then
        self.x = x - self.xx
        self.y = y - self.yy
        --渐进加载界面_进度条:_消息事件("窗口移动",self.x-90,self.y-65)
    end
end
return 场景类_便捷打书